package com.sufen.gb;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.sufen.gb.dao.DictMapper;
import com.sufen.gb.entity.Dict;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;

import javax.annotation.Resource;
import java.sql.Wrapper;

/**
 * @description: 在scanBasePackages中添加项目执行需要扫描的包路径
 * @function:
 * @author: Liu Menglei
 * @Date: 2021/11/30 0030 15:16
 */
@SpringBootApplication(scanBasePackages = {
        "com.sufen.persistence",
        "com.sufen.gb",
        "com.sufen.common"})
public class GBApplication {
    private static final Logger logger = LoggerFactory.getLogger(GBApplication.class);
    @Resource
    DictMapper dictMapper;

    public static void main(String[] args) {
//        ConfigurableApplicationContext context=  SpringApplication.run(GBApplication.class, args);
        SpringApplication.run(GBApplication.class, args);
    }

    @Bean
    public CommandLineRunner commandLineRunner(ApplicationContext ctx){
        return args->{
            logger.info("开始执行测试任务");
        };
    }

}